package org.com.ashen.service.dao;
//package org.xyz.test.service.dao;
//
//import java.io.BufferedInputStream;
//import java.io.BufferedOutputStream;
//import java.io.BufferedReader;
//import java.io.ByteArrayOutputStream;
//import java.io.FileInputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.InputStreamReader;
//import java.io.OutputStream;
//import java.io.PrintWriter;
//import java.io.UnsupportedEncodingException;
//import java.io.Writer;
//import java.math.BigInteger;
//import java.net.ConnectException;
//import java.net.HttpURLConnection;
//import java.net.URL;
//import java.net.URLConnection;
//import java.net.URLDecoder;
//import java.text.SimpleDateFormat;
//import java.util.ArrayList;
//import java.util.Base64;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.Random;
//import java.util.Scanner;
//import java.util.UUID;
//
//import org.apache.commons.lang3.StringEscapeUtils;
//import org.junit.Test;
//import org.xyz.test.service.util.CodeUtil;
//import org.xyz.test.service.util.GZIPUtils;
//
//import com.alibaba.fastjson.JSON;
//import com.aliyun.oss.OSSClient;
//import com.aliyun.oss.model.Bucket;
//
//import net.sourceforge.pinyin4j.PinyinHelper;
//import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
//import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
//import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
//
//public class SysWM {
//
//	private static final String DEFAULT_ENCODING = "UTF-8";// 编码
//	private static final int PROTECTED_LENGTH = 51200;// 输入流保护 50KB
//
//	
//	
//	
//		@Test
//	public void httpRequest() {
////		String requestUrl = "http://192.168.160.1:8080/assaas/assaas";
////		String requestUrl = "http://192.168.1.118:8080/tms1/assaas";
////		String requestUrl = "http://47.111.144.190/tms1/assaas";
////		String requestUrl = "http://192.168.1.108:8080/dataexchange/queryClassifyInfoList";
////		String requestUrl = "http://192.168.1.107:8080/dataexchange/getMemberDetail";
//		String requestUrl = "http://www.hbxtwl.cn/dataexchange/getMemberDetail";
////		String requestUrl = "http://www.hbxtwl.cn/dataexchange/queryClassifyInfoList";
////		String outputStr = "injson={\"file\":\"https://www.hbxtwl.cn/images/a.jpg\",\"name\":\"得到的.jpg\"}&signtype=weimeng";
//		String outputStr = "injson={\"type\":0,\"wid\":\"1854961826\"}&signtype=weimeng";
//
//		System.out.println( "response"+ new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss:SSS").format(new Date()));
//		String requestMethod = "GET";
//		StringBuffer buffer = new StringBuffer();
//		InputStream inputStream = null;
//		try {
//			URL url = new URL(requestUrl);
//			HttpURLConnection httpUrlConn = (HttpURLConnection) url.openConnection();
//			httpUrlConn.setDoOutput(true);
//			httpUrlConn.setDoInput(true);
//			httpUrlConn.setUseCaches(false);
//			// 设置请求方式（GET/POST）
//			httpUrlConn.setRequestMethod(requestMethod);
//			if ("GET".equalsIgnoreCase(requestMethod))
//				httpUrlConn.connect();
//			// // 当有数据需要提交时
//			if (null != outputStr) {
//				OutputStream outputStream = httpUrlConn.getOutputStream();
//				// 注意编码格式，防止中文乱码
////				outputStream.write(outputStr.getBytes("UTF-8"));
//				outputStream.write(outputStr.getBytes());
//				outputStream.close();
//			}
//
//			// 将返回的输入流转换成字符串
//			inputStream = httpUrlConn.getInputStream();
//			String result = readInfoStream(inputStream);
//			 
////			String result = buffer.toString();
////		    result=GZIPUtils.uncompressToString(result.getBytes("ISO-8859-1"));
////		    GZIPUtils.string2File(result, "C:/Users/Administrator/Desktop/d.zip");
////		    result = CodeUtil.Decode(result);
//		    System.out.println( "response"+ new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss:SSS").format(new Date()));
//			System.out.println(result);
//		} catch (ConnectException ce) {
//			ce.printStackTrace();
//			System.out.println("Weixin server connection timed out");
//		} catch (Exception e) {
//			e.printStackTrace();
//			System.out.println("http request error:{}");
//		} finally {
//			try {
//				if (inputStream != null) {
//					inputStream.close();
//				}
//			} catch (IOException e) {
//				e.printStackTrace();
//			}
//		}
//	}
//
//	@SuppressWarnings("finally")
//	public String readInfoStream(InputStream input) throws Exception {
//		ByteArrayOutputStream infoStream = null;
//		try {
//			if (input == null) {
//				throw new Exception("输入流为null");
//			}
//			byte[] bcache = new byte[2048];
//			int readSize = 0;// 每次读取的字节长度
//			int totalSize = 0;// 总字节长度
//			infoStream = new ByteArrayOutputStream();
//
//			while ((readSize = input.read(bcache)) > 0) {
//				totalSize += readSize;
//				infoStream.write(bcache, 0, readSize);
//			}
//		} catch (Exception e1) {
//			throw new Exception("输入流读取异常");
//		} finally {
//			try {
//				input.close();
//				return infoStream.toString(DEFAULT_ENCODING);
//			} catch (Exception e) {
//				throw new Exception("输出异常");
//			}
//		}
//	}
//
//	
//	
//	
//	
//	
//	
//	
//	
//	
//	
//	
//	
//	
//	 
//}